Superdesk Web Publisher Documentation Release 0.5.0
Total Page:16
File Type:pdf, Size:1020Kb
Superdesk Web Publisher Documentation Release 0.5.0 Sourcefabric z.ú. Mar 23, 2021 Contents 1 Manual 3 1.1 Introduction...............................................3 1.1.1 Why choose Publisher?.....................................3 1.1.2 What is Publisher’s focus?...................................4 1.1.3 How is Publisher structured?..................................4 1.1.4 Notable features.........................................4 1.1.5 Website architecture......................................4 1.2 Getting started..............................................5 1.2.1 Installing Superdesk Publisher.................................5 1.2.2 How to Install and Configure Superdesk Publisher with Superdesk.............. 10 1.2.3 Configuring Publisher...................................... 13 1.2.4 Managing websites and routes................................. 14 1.2.5 Navigation management.................................... 20 1.2.6 Configure image formats.................................... 21 1.3 Templates System............................................ 24 1.3.1 Rendering pages with Twig................................... 24 1.3.2 Creating a page templates.................................... 25 1.3.3 Creating custom templates................................... 25 1.3.4 Properties............................................ 25 1.3.5 Templates features....................................... 25 1.3.6 Handling Articles........................................ 31 1.3.7 Handling Related Articles................................... 33 1.3.8 Handling Article Media..................................... 33 1.3.9 Handling Article Authors.................................... 34 1.3.10 Handling Article Slideshows.................................. 36 1.3.11 Handling Routes........................................ 38 1.3.12 Handling Content List Items.................................. 39 1.3.13 Keywords............................................ 40 1.3.14 Template Caching........................................ 41 1.3.15 How to implement Search using ElasticSearch?........................ 42 1.3.16 Tips............................................... 43 1.3.17 Templates inheritance...................................... 43 1.3.18 How to change the Route/Article template name?....................... 44 1.4 Themes.................................................. 44 1.4.1 About themes and multitenancy................................ 44 1.4.2 Create or install a theme.................................... 46 i 1.4.3 Work with theme assets..................................... 47 1.4.4 Translations........................................... 48 1.4.5 AMP HTML Integration.................................... 49 1.4.6 Theme Settings......................................... 50 1.4.7 Example themes......................................... 52 1.5 Editorial tools.............................................. 53 1.5.1 Content Lists.......................................... 53 1.6 Admin Interface............................................. 54 1.6.1 Publisher Settings........................................ 54 1.6.2 Publisher dashboard....................................... 64 2 Cookbooks 71 2.1 Templates Cookbooks.......................................... 71 2.1.1 Users registration and login................................... 71 2.1.2 Create new route with extension (example: feed/sitemap.rss)............. 73 2.1.3 Create new custom route.................................... 73 2.1.4 Most popular (read) articles list................................. 74 2.1.5 Elements generated on theme installation........................... 75 2.2 Technical Cookbooks.......................................... 76 2.2.1 Installing Composer....................................... 76 2.2.2 Updating database schema after customizing model’s mapping................ 77 2.2.3 Meta Loaders.......................................... 77 2.2.4 Content Lists.......................................... 79 2.2.5 Article Preview......................................... 80 2.2.6 Rules.............................................. 81 2.2.7 Usage.............................................. 83 2.2.8 WebSocket Communication.................................. 89 2.2.9 Paywall............................................. 89 2.2.10 GeoIP.............................................. 93 2.3 Editors Cookbooks............................................ 94 2.3.1 Facebook Instant Articles Integration.............................. 94 2.4 Implementators Cookbooks....................................... 96 2.4.1 Secure content push to Publisher................................ 96 2.4.2 [Migration] Redirect articles from previous url’s to publisher................. 97 2.4.3 Setup Wordpress as a Publisher Output Channel........................ 97 2.4.4 Setup oAuth login with auth0.com............................... 98 3 Reference 101 3.1 System Requirements.......................................... 101 3.2 Twig Extensions............................................. 101 3.2.1 Functions............................................ 101 4 Bundles 103 4.1 Fixtures Bundle............................................. 103 4.1.1 Overview............................................ 103 4.1.2 How to use fixtures....................................... 103 4.1.3 Creating a simple PHP fixture class.............................. 103 4.1.4 Creating a simple Alice fixture (YAML format)........................ 104 4.1.5 Loading all fixtures....................................... 105 4.1.6 Setting up a demo theme.................................... 105 4.2 MultiTenancyBundle........................................... 105 4.2.1 Prerequisites.......................................... 106 4.2.2 Installation........................................... 106 4.2.3 Services............................................. 108 ii 4.2.4 PHPCR ODM Repository Initializer.............................. 109 4.2.5 Repositories........................................... 109 4.2.6 SQL Query Filters....................................... 110 4.2.7 Event Listeners......................................... 110 4.2.8 Console Commands....................................... 110 4.2.9 Twig Extension......................................... 112 4.2.10 Configuration Reference.................................... 112 4.2.11 Tutorials............................................. 118 4.3 StorageBundle.............................................. 121 4.3.1 Prerequisites.......................................... 121 4.3.2 Installation........................................... 121 4.3.3 Usage.............................................. 122 4.4 BridgeBundle............................................... 135 4.4.1 Prerequisites.......................................... 135 4.4.2 Installation........................................... 135 4.4.3 Usage.............................................. 136 4.5 ContentBundle.............................................. 140 4.5.1 Usage.............................................. 140 4.6 RuleBundle................................................ 151 4.6.1 Prerequisites.......................................... 152 4.6.2 Installation........................................... 152 4.6.3 Usage.............................................. 153 4.6.4 Models............................................. 158 4.6.5 Configuration Reference.................................... 158 4.7 ContentListBundle............................................ 160 4.7.1 Prerequisites.......................................... 160 4.7.2 Installation........................................... 161 4.7.3 Usage.............................................. 162 4.7.4 Models............................................. 166 4.7.5 Configuration Reference.................................... 166 4.8 FacebookInstantArticlesBundle..................................... 170 4.8.1 Authentication......................................... 170 4.8.2 Article Parsing......................................... 171 4.9 SettingsBundle.............................................. 171 4.9.1 Installation........................................... 171 4.9.2 Settings definitions....................................... 172 4.9.3 Usage.............................................. 173 4.9.4 Scope context.......................................... 174 4.10 WebhookBundle............................................. 174 4.10.1 Installation........................................... 175 4.10.2 Usage.............................................. 175 4.11 OutputChannelBundle.......................................... 176 4.11.1 Installation........................................... 176 4.11.2 Usage.............................................. 176 4.12 Paywall Bundle.............................................. 177 4.12.1 Installation........................................... 177 4.12.2 Usage.............................................. 178 4.13 SeoBundle................................................ 179 4.13.1 Installation........................................... 179 5 Developer Guide 181 5.1 Contributing............................................... 181 5.1.1 Contributing Code....................................... 181 5.1.2 Contributing Documentation.................................. 196 iii 5.1.3 Community........................................... 208 5.2 Components............................................... 211 5.2.1 How to Install and Use the Components............................ 211